<?php

namespace App\Http\Controllers;

use App\Models\Job;
use App\Services\JobServices;
use Illuminate\Http\Request;

class JobController extends WxController
{

    public function getAllJob(Request $request){
        $this->validate($request, [
            'page' => 'required|integer',
            'word' => 'required|string'
        ]);
        $data = [];
        $Job = JobServices::getInstance()->getAllJob();
        $data['list']=$Job;
        return $this->success($data);
    }

    public function search(Request $request){
        $key = $request['key'];
        $this->validate($request, [
            'key' => "required|string|max:100",
        ]);
        $data = JobServices::getInstance()->searchJob($key);
        return $this->success(['list'=>$data]);
    }
     //职位推荐
    public function getReJob(){
        $hotJob = JobServices::getInstance()->getHotJob();
        return $this->success(['list'=>$hotJob]);
    }

}
